/**
 * Copyright 2005 The Apache Software Foundation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.edi.proxy.component
{
	/**
	 * 构造WAP协议
	 * 
	 **/
	public class WAPParam extends POParam implements IPOParam
	{
		private var _method:String = "";
		private var _dsName:String="defaultDsName";
		private var _projectXML:XML = new XML;
		
		/**
		*	EPOParam		
		*	构造方法：	EPOParam(eql:String=null)	
		*	构造EQL语句请求串 格式如下：	
 		*  <ds>
 		*  <caller/>
 		*  <appName>应用名称</appName>
 		*  <WAPParam>
 		*  <methods>方法名称</methods>
 		*  <project>WAPXML</project>
 		*  </WAPParam>
 		*  </ds>
 		*  var wap:WAPParam = new WAPParam(projectXML);
 		*  wap.method="DBCommon.METHOD_SAVE";
 		* 	
 		**/
 		public function WAPParam(_projectXML:XML):void{
 			this._projectXML = _projectXML;
 		}
 		 
		/**
		 * 方法名;对应toXML()中的<method></method>
		 * @param _method
		 * 在DBCommon中取值
		 **/
		public function set method(_method:String):void{
			this._method = _method;
		}
		
		/**
		 * 方法名;对应toXML()中的<project></project>
		 * @param _method
		 * 在DBCommon中取值
		 **/
		public function set projectXML(_projectXML:XML):void{
			this._projectXML = _projectXML;
		}
		
		/**
		 * 方法名;对应toXML()中的<dsName></dsName>
		 * @param _dsName
		 **/
		public function set dsName(_dsName:String):void{
			this._dsName=_dsName;
		}
		
		
		/**
		 * 组成WAPParam协议串；格式如下 
		 * @return 
		 *  <ds>
		 *	  <caller/>
		 *	  <appName></appName>
		 *	  <WAPParam>
		 *	    <method></method>
		 * 		<project></project>
		 *	  </WAPParam>
		 *	</ds>
		 */	
		override public function toXml():XML
		{
			var wxml:XML=new XML(<WAPParam />);
			wxml.appendChild(<dsName>{_dsName}</dsName>);
			wxml.appendChild(<method>{_method}</method>);
			wxml.appendChild(<project>{_projectXML}</project>);
			return wxml;
		}
		
	}
}